@echo off

rem /**
rem  * @author Aleske A. Evdokimov <ale@izhcat.ru>
rem  * @version $Id: download.bat 16 2009-04-23 12:04:35Z workales $
rem  */

setlocal enableextensions

php downloader.php regions_000_sat.lst testdata 0 --prefix=sat_000_
php downloader.php regions_001_pkg.lst testdata 0 --prefix=pkg_001_

for %%F in (testdata\sat_000_*.html) do (
  php repearser.php %%F lst_000_sat.def --no-head > %%~dpF%%~nF.csv
)

for %%F in (testdata\pkg_001_*.html) do (
  php repearser.php %%F lst_001_pkg.def --no-head > %%~dpF%%~nF.csv
  php repearser.php %%F pak_001_pkg.def --no-head > %%~dpF%%~nF.c$v
)

del testdata\*.html

for %%F in (testdata\sat_000_*.csv) do (
  php downloader.php %%F testdata 3 --prefix=sat_
)

for %%F in (testdata\pkg_001_*.csv) do (
  php downloader.php %%F testdata 4 --prefix=pkg_
)

del testdata\*.csv

for %%F in (testdata\sat_*.html) do (
  for %%I in (sat_*.def) do (
    php repearser.php %%F %%I --no-head >> %%~dpF%%~nI.csv
  )
)

for %%F in (testdata\pkg_*.html) do (
  for %%I in (pkg_*.def) do (
    php repearser.php %%F %%I --no-head >> %%~dpF%%~nI.csv
  )
)

copy testdata\pkg_*.c$v testdata\pkg_001_pkg.csv

del testdata\*.c$v
del testdata\*.html
